package com.tiancheng.trade.order.enums;

import com.tiancheng.trade.commom.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务类型标识
 *
 * @author likailun
 * @date 2024/12/17
 */
@Getter
@AllArgsConstructor
public enum BusinessTypeEnum implements BaseEnum<String> {

	B2B("B2B", "B2B"),
	B2C("B2C", "B2C"),
	G2C("G2C", "G2C"),
	;

	private String code;
	private String desc;

	public static String getDesc(String code) {
		BusinessTypeEnum[] businessModeEnums = values();
		for (BusinessTypeEnum statusEnum : businessModeEnums) {
			if (statusEnum.code().equals(code)) {
				return statusEnum.desc();
			}
		}
		return null;
	}

	public String code() {
		return this.code;
	}

	public String desc() {
		return this.desc;
	}
}
